package cn.doitedu.udfs;

import org.apache.flink.table.functions.ScalarFunction;

import java.sql.Timestamp;

public class TimeStampFloorUDF extends ScalarFunction {

    public String eval(Timestamp ts,int interval){

        long tmp = interval*60*1000;
        long result =(ts.getTime()/tmp)*tmp;

        return new Timestamp(result).toString();

    }

}
